Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #260 #266

Merged

Conversation

OnnoEbbens
Copy link
Collaborator

No description provided.

@rubencalje
Copy link
Collaborator

Hmm, I see from the tests:

extent = (0.22, 1056.12, 7.43, 1101.567)
new_extent = nlmod.dims.snap_extent(extent, 10, 20)
assert new_extent == [-5.0, 1065.0, -10.0, 1110.0]

So the center of cells within the new extent is snapped to the closest multiple of delr/delc. I am more in favor of snapping the edge of cells to the closest multiple of delr/delc, like:

extent = (0.22, 1056.12, 7.43, 1101.567)
new_extent = nlmod.dims.snap_extent(extent, 10, 20)
assert new_extent == [0.0, 1060.0, 0.0, 1120.0]

Regis is also defined in intervals of 100 m, so from x = 100.000 until 100.100, x = 100.100 until 100.200 and so on. With your approach half of a cell would be in one regis-cell, and the other half would be in another one (if I am not mistaken).

@OnnoEbbens
Copy link
Collaborator Author

I agree that makes a lot more sense

@OnnoEbbens
Copy link
Collaborator Author

Two of the tests for the knmi data platform fail that are not related to this, I created an issue for this (#272) and will merge this PR.

@OnnoEbbens OnnoEbbens merged commit 40989db into dev Oct 18, 2023
2 of 3 checks passed
@OnnoEbbens OnnoEbbens deleted the 260-reinstate-fit_extent_to_regis-under-a-different-name branch October 19, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reinstate fit_extent_to_regis under a different name
2 participants